package com.wyl.studyjavaxvalidation.dto;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;

/**
 * @author 吴宇亮 on 2021/12/20 11:32
 */
public class PersonDto {

    @NotBlank(message = "姓名不能为空")
    private String name;
    @Min(value = 0, message = "年龄必须大于等于0")
    private Integer age;
    private String sex;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "PersonDto{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                '}';
    }
}
